package com.mmall.dao;

import com.mmall.pojo.Product;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

public interface ProductMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Product record);

    int insertSelective(Product record);

    Product selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Product record);

    int updateByPrimaryKey(Product record);

    int updateSaleStatusByPrimaryKey(@RequestParam(value = "id") Integer productId, @RequestParam("status") String status);

    List<Product> getProductList();

    List<Product> searchProductList(@RequestParam(value = "productName")String productName, @RequestParam("id") Integer productId);

    List<Product> searchProdsByCateOrName(@RequestParam(value = "productName")String keyword, @RequestParam("categoryId") Integer categoryId);
}